<?php

class SiteController extends Controller
{
	public function actions()
	{
		return array(
				// captcha action renders the CAPTCHA image displayed on the contact page
				'captcha'=>array(
						'class'=>'CCaptchaAction',
						'backColor'=>0xFFFFFF,
				),
				// page action renders "static" pages stored under 'protected/views/default/pages'
				// They can be accessed via: index.php?r=default/page&view=FileName
				'page'=>array(
						'class'=>'CViewAction',
				),
		);
	}
	public function actionError()
	{
		$flag = true;
		
		
		$nowurl = Yii::app()->request->url;
		
		$nowtest = $this->createUrl($this->getId());
		//echo $nowtest,"ddd",$nowurl;exit;
		
		if($error=Yii::app()->errorHandler->error)
		{
			if(Yii::app()->request->isAjaxRequest)
				echo $error['message'];
			else
				$this->render('application.views.default.error', $error);
		}
	}
	public function actionIndex()
	{
		echo __FILE__;
	}
	public function actionTiming()
	{
		ignore_user_abort();//关掉浏览器，PHP脚本也可以继续执行.
		set_time_limit(30);
		$interval = 30;
		$obj = new Timing();
		$obj->init();
		do{
			$r = $obj->addnum();
			var_dump($r);
			sleep($interval);// 等待5s
		}while(true);
		
		
	}
}